package com.example.demo.pattern.observerpattern;


import com.example.demo.pattern.observerpattern.display.DisplayBoard1;
import com.example.demo.pattern.observerpattern.station.WeatherStation;

public class Start {
    public static void main(String[] args) {
        //该对象应为单例，但在集群下单例也不够，还要保证多jvm下不重复注册、发送，感觉得消息队列
        WeatherStation weatherStation = new WeatherStation();
        DisplayBoard1 displayBoard1 = new DisplayBoard1(weatherStation);
        weatherStation.registerObserver(displayBoard1);
        weatherStation.setMeasurements("1", "2", "3");

        weatherStation.removeObserver(displayBoard1);
        weatherStation.setMeasurements("1", "2", "3");
    }
}
